Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Overhaul build process with setuptools_scm and written version file #197

Merged
merged 4 commits into from
Sep 20, 2023

Conversation

djhoese
Copy link
Member

@djhoese djhoese commented Sep 20, 2023

This fixes various issues encountered with new versions of setuptools_scm. Pyspectral was depending on a deprecated package setuptools_scm_git_archive whose features are now included upstream in setuptools_scm.

Additionally I removed a hack in setup.py that was copied from satpy to tell setuptools_scm to not copy every file that git knows about. This has been worked around in recent versions of setuptools_scm by allowing you to exclude files from your MANIFEST.in. However, I find it very annoying to have to exclude everything that might be unnecessary so instead I exclude everything and then add what we want back in.

I removed all the mocking in the docs and just added those dependencies to the RTD environment.

I also switched from a dynamic version loading that was using pkg_resources to a configuration where setuptools_scm writes a pyspectral/version.py file. This is better for import performance and avoids the usage of the deprecated pkg_resources package. This package is used elsewhere in pyspectral and will need to be replaced with importlib.resources (I think that's the name) so FYI @adybbroe.

Let me know if you have any questions. We need this merged ASAP so that other packages can install pyspectral from source again.

  • Closes #xxxx
  • Tests added
  • Tests passed: Passes pytest pyspectral
  • Passes flake8 pyspectral
  • Fully documented
  • Add your name to AUTHORS.md if not there already

@djhoese djhoese added bug dependencies Pull requests that update a dependency file labels Sep 20, 2023
@djhoese djhoese self-assigned this Sep 20, 2023
@codecov
Copy link

codecov bot commented Sep 20, 2023

Codecov Report

Merging #197 (9a21305) into main (fb40e2d) will decrease coverage by 0.01%.
The diff coverage is 60.00%.

@@            Coverage Diff             @@
##             main     #197      +/-   ##
==========================================
- Coverage   89.23%   89.23%   -0.01%     
==========================================
  Files          23       23              
  Lines        2537     2536       -1     
==========================================
- Hits         2264     2263       -1     
  Misses        273      273              
Flag Coverage Δ
unittests 89.23% <60.00%> (-0.01%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

Files Changed Coverage Δ
pyspectral/tests/test_rayleigh.py 100.00% <ø> (ø)
pyspectral/__init__.py 60.00% <33.33%> (-6.67%) ⬇️
pyspectral/tests/test_utils.py 98.09% <100.00%> (ø)
pyspectral/utils.py 90.98% <100.00%> (ø)

Copy link
Member

@mraspaud mraspaud left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good to me, just small questions.

pyspectral/__init__.py Outdated Show resolved Hide resolved
.gitignore Show resolved Hide resolved
Co-authored-by: Martin Raspaud <[email protected]>
@djhoese
Copy link
Member Author

djhoese commented Sep 20, 2023

pre-commit.ci autofix

@djhoese djhoese merged commit ea01a9f into pytroll:main Sep 20, 2023
13 of 16 checks passed
@djhoese djhoese deleted the remove-scm-git-archive branch September 20, 2023 18:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug dependencies Pull requests that update a dependency file
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants